package es.unileon.prg2.censo.composite;

/**
 * @author Manuel Molinos Crespo, Adrian Campazas Vega, Alberto Castro Delgado, Pedro Alvarez Alvarez, Adrian Cabello Galvan, Jose Alvaro Fernandez Alvarez
 *
 */

import es.unileon.prg2.censo.exception.CensoException;
import es.unileon.prg2.censo.handler.GenericId;
import es.unileon.prg2.censo.handler.Handler;
import es.unileon.prg2.censo.iterator.Iterador;

public class Region extends Composite {
	private static final String LEVEL = "Region";
	private Handler IDRegion;
	
	/**
	 * Constructor used to created an Region object.
	 * @param id Handler with the ID of this Region object
	 * @throws CensoException
	 */
	public Region(Handler id) throws CensoException {
		this.IDRegion = id; 
	}
	
	/**
	 * Other constructor used to created an Region object from a String.
	 * @param id String with the ID of this Region object
	 * @throws CensoException
	 */
	public Region(String id) throws CensoException {
		this.IDRegion = new GenericId(id); 
	}
	
	@Override
	public String getLevel() {
		return this.LEVEL;
	}
	
	@Override
	public Handler getId() {
		return this.IDRegion;
	}
	
	@Override
	public String toString() {
		return "\n\t\tRegion: " + this.getId().toString() + super.toString();
	}
	
	@Override
	public int getAge() {
		return 0;
	}
}
